<template>
  <div>
    <h2>计算属性</h2>
    <input type="text" v-model="xing">
    <input type="text" v-model="ming">
    <input type="text" v-model="fullName">
  </div>
</template>

<script>
export default {
  data(){
    return{
      xing:'张',
      ming:'三'
    }
  },
  computed: {
    fullName:{
      get(){
        return this.xing +this.ming
      },
      set(val){
        let arr = val.split(' ')
        this.xing = arr[0]
        this.ming = arr[1]
      }
    }
  }
}
</script>

<style lang="">
  
</style>